var vm = new Vue({
    el:'#app',
    data:{
        host:'http://127.0.0.1:8000/',
        navinfo:[],//获取导航
        ficinf:[],
        web_ficinf:[],//图片小说
        keyworks:[],//关键字

    },
    mounted:function(){
        this.fic()
        this.get_fic()

    },
    methods:{
        //获取导航
         fic:function () {

            axios.get(this.host+'nav/',{
            }).then(response=>{
                this.navinfo=response.data

            }).catch(error=>{

            })
        },

        //获取小说名字
        get_fic:function (nav_id,nav_name) {
            axios.get(this.host+'allfic/',{

            }).then(response=>{
                this.web_ficinf = response.data

            }).catch(error=>{

            })

        },
              //跳转全部小说页面
        allfic:function () {
            window.location='allfic.html'
        },
        //跳转
           detail:function (nav_id) {
            window.location = 'index.html?nav_id='+nav_id
        },
        search:function () {
            axios.get(this.host+'searchs/'+this.keyworks,{
            }).then(response=>{
                this.web_ficinf = response.data
            }).catch(error=>{
                alert('没有')
            })
        },
        //跳转到章节页面
          detailzhangjie:function (fic_id) {
            window.location = 'zhangjie.html?fic_id='+fic_id
        },







    }
})